package com.sumainfor.pc.gmio.controller.housekeeper;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.gmio.service.HoEleMeterService;
import com.sumainfor.pc.gmio.service.HoWaterMeterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.Serializable;
import java.util.Map;

/**
 * 服务管家水电燃表数录入
 */
@RestController
@RequestMapping("/secretary/HoWaterMeter")
public class HoWaterMeterController implements Serializable {
    @Autowired
    private HoWaterMeterService hoWaterMeterService;
    /**
     * 查询水表的信息列表
     */
    @PostMapping("/getHoWaterMeterList")
    public JsonResult getHoWaterMeterList(@RequestBody Map<String,Object>params){
        System.out.println("接收到达参数:"+params);
        return hoWaterMeterService.getHoWaterMeterList(params);
    }
    /**
     * 服务管家录入电表数
     */
    @PostMapping("/addHoWaterMeter")
    public JsonResult addHoWaterMeter(@RequestBody Map<String,Object>params){
        return hoWaterMeterService.addHoWaterMeter(params);
    }
    /**
     *服务管家退租的时候查询上次的水表抄表数
     */
    @GetMapping("/getHoWaterMeterLast")
    public JsonResult getHoWaterMeterLast(@RequestParam Map<String,Object>params){
        JsonResult result=new JsonResult();
        return result.put(hoWaterMeterService.getHoWaterMeterLast(params));
    }
    /**
     *服务管家退租的时候查询上次的水表抄表数
     */
    @GetMapping("/getHoWaterMeterBatc")
    public JsonResult getHoWaterMeterBatc(@RequestParam Map<String,Object>params){
        return hoWaterMeterService.getHoWaterMeterBatc(params);
    }
    /**
     *租后主管撤回电表账单(账单错误)
     */
    @PostMapping("/recallHoWaterMeter")
    public JsonResult recallHoWaterMeter(@RequestBody Map<String,Object>params){
        return hoWaterMeterService.recallHoWaterMeter(params);
    }
    /**
     *租后主管撤回电表账单(审核错误)
     */
    @PostMapping("/examHoWaterMeter")
    public JsonResult examHoWaterMeter(@RequestBody Map<String,Object>params){
        return hoWaterMeterService.examHoWaterMeter(params);
    }
}
